UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't3TBxt62rqTn06Fow0vl785lCP5AyvUKnrG7RrJvnyU=' 
WHERE 
  key_id = 'f201d86d1c8dc38b836d32bd023d9f45a98383d817c80a2731a1dc0030dbf6a6' 
  AND (
    token = 't3TBxt62rqTn06Fow0vl785lCP5AyvUKnrG7RrJvnyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034