UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7sRu3gTKf6GcQVLiUmwMjK+MzcuRud4V0CNGiDW1GiU='
WHERE
key_id = '6b41735ed6d5f295b5286d74c3f4a71fe406ce53d2f21c459e179ba2bfc6f8da'
AND (
token = '7sRu3gTKf6GcQVLiUmwMjK+MzcuRud4V0CNGiDW1GiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)