UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e3+IcYhE9+Y1g8Tx9ZesB9XMSIAMOlMgYsToRjvP9dc='
WHERE
key_id = '1b50a93049e5913eb5dab73b0cacb6f1daecb2a23ecd576ef1f62b9f169754b4'
AND (
token = 'e3+IcYhE9+Y1g8Tx9ZesB9XMSIAMOlMgYsToRjvP9dc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)