UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ru3achUtB5JOWzdAdshzfmGjeJtFWSdhMbnAIYjWY28='
WHERE
key_id = '8637c01e1dffa5aaff4dac0b28b4dc9335e0414748566609b3a0a7a7fd2a0c26'
AND (
token = 'Ru3achUtB5JOWzdAdshzfmGjeJtFWSdhMbnAIYjWY28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)