UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AlLaEe9ehMFClF0G+c0a8fb4Y6q4wBW38FYrVooFBl8='
WHERE
key_id = '18f694651326524686207fe09905dcb4cfc71a1a5a25fd8898dd6f528f6525ed'
AND (
token = 'AlLaEe9ehMFClF0G+c0a8fb4Y6q4wBW38FYrVooFBl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)