UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8TFC003JhajkQVkCEu8wBBnAifBLGzdBQlkcWJu7w4M=' 
WHERE 
  key_id = '70c41c4b25b06d58155ddd71c37a4904a32b9bdfc0f0ba0c4b3d604b4da42a41' 
  AND (
    token = '8TFC003JhajkQVkCEu8wBBnAifBLGzdBQlkcWJu7w4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086