UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FYoibOUc4gs26u3lclyAhDdDksevCYdmMcG9hUh4dZc='
WHERE
key_id = 'abc472e61b7e5b337bfadc8e23a356c017f6f67e0f2627b3447c750eb29fd1e4'
AND (
token = 'FYoibOUc4gs26u3lclyAhDdDksevCYdmMcG9hUh4dZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)