UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TJLJXRyOLqu+bnL7fu9rbN6Tx3Cr8/976JRcAdSFAVg='
WHERE
key_id = 'a5a9d5dccd87e219aebe26588b986e7cc060f7a27b92fdc7488ea1281c9f94e4'
AND (
token = 'TJLJXRyOLqu+bnL7fu9rbN6Tx3Cr8/976JRcAdSFAVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)