UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dS8daJ/F1vOR2lcnMa46N37VPMfQLbqpBvvybzjj2SE='
WHERE
key_id = 'd85362cf78558636a56d345534c035955b87826ea4f5998761fa78e4053775ab'
AND (
token = 'dS8daJ/F1vOR2lcnMa46N37VPMfQLbqpBvvybzjj2SE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)