UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b/B/PC2NIe7syK7Ijz737T/2UzW3Av6FzjHxfIGzomw=' 
WHERE 
  key_id = '4883dded70f329a1fe712512cb46e69c5f3e8ad94b73524bfaf1c825b9266e9d' 
  AND (
    token = 'b/B/PC2NIe7syK7Ijz737T/2UzW3Av6FzjHxfIGzomw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027