UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xWVEjRG3RRxZuV2LFgSbGFRlA85kESRFTuTCMuQ04+g='
WHERE
key_id = '8f7794211d20af5c870e093a23d9e1174e18eeccbb087db3572f40a77910d608'
AND (
token = 'xWVEjRG3RRxZuV2LFgSbGFRlA85kESRFTuTCMuQ04+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)