UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zkxb0yKZiC0RkQ+nG4bB8wXWj/AS31/lXHn7HZTNqlY='
WHERE
key_id = 'b00806c5b121794c72aa3f56bf11c8ba25a645c84955106d19016ac372a768f0'
AND (
token = 'zkxb0yKZiC0RkQ+nG4bB8wXWj/AS31/lXHn7HZTNqlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)