UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oR/BWcFgp9E0v/x0eR9qAhKnP5JkibGGHPjubEeiWMY='
WHERE
key_id = 'df081531e1130ff921b2aa7bc161d40d71c034c28ab60982ca0426f22e29b15d'
AND (
token = 'oR/BWcFgp9E0v/x0eR9qAhKnP5JkibGGHPjubEeiWMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)