UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o6S9OKFbs2veFMglzEd0IuSQwxNrn2oDe+jQVjAs5ZM='
WHERE
key_id = '3be151f8ecfe31f648d900ffee51464d5f8d0a229426d5626c0ac40688a5b102'
AND (
token = 'o6S9OKFbs2veFMglzEd0IuSQwxNrn2oDe+jQVjAs5ZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)