UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ODHCt411gwtjDChRLKucPQOaSjMMoGuya66uLCS4aS4='
WHERE
key_id = '2ed4a8a14647f2000b9a8738ec0110ec2d8d726f65ff4c71b13f1ad57e4b433b'
AND (
token = 'ODHCt411gwtjDChRLKucPQOaSjMMoGuya66uLCS4aS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)