UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E061yyYzUCkoV3XRISULMFmhfCseOKz1jLgCmDsp+D8='
WHERE
key_id = 'e3d94db115df538dc2a6af4b8eeb93a980672d1c979a2b53362f6df0baf6a6f8'
AND (
token = 'E061yyYzUCkoV3XRISULMFmhfCseOKz1jLgCmDsp+D8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)