UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7aNy+BzEYOjkx5YYTZQ3YJdJmPqSEXL12yopcfqBshQ='
WHERE
key_id = '10d786fdf689aedf63c39725c5c068891ff01da17570fb8b02b227948956fd9b'
AND (
token = '7aNy+BzEYOjkx5YYTZQ3YJdJmPqSEXL12yopcfqBshQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)