UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'elUXRjHT80brWiVubwWYDJfXcN7cIUhND9yWZ/FXsAw='
WHERE
key_id = 'b3ba7a72e69f8ed0b9afd20d54af35659d463446f70e47a79a1e77af6ff48281'
AND (
token = 'elUXRjHT80brWiVubwWYDJfXcN7cIUhND9yWZ/FXsAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)