UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3q7FWMfUjtJ9XnB+yPn/ob6tO6+8mtST+PTZOz4rL9I=' 
WHERE 
  key_id = '503658423b2582c288e016895dd4fce79cf4a56802993c288177c01e15ae92e0' 
  AND (
    token = '3q7FWMfUjtJ9XnB+yPn/ob6tO6+8mtST+PTZOz4rL9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00147