UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ANuWnM3cWXFOYHf0IiIsWP+FSdaQjN4HXz65l0IkUDc=' 
WHERE 
  key_id = 'e801de764ddae4192216cea0664988a1224f124d574c79349724dc572d15e637' 
  AND (
    token = 'ANuWnM3cWXFOYHf0IiIsWP+FSdaQjN4HXz65l0IkUDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026