UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E0OT0I1KwwefLa7fxkKh6S0r7rq2Igxc6sYFOryA7LE='
WHERE
key_id = 'fc3a34e8c6f9dd4dbb99f8d396f8f545ae48a64904b0e3a111925303dab8a64a'
AND (
token = 'E0OT0I1KwwefLa7fxkKh6S0r7rq2Igxc6sYFOryA7LE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)