UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VZfyGclds4RmWYNk81jPKY2L1O+fPb+b7G8Yp+dYBWU=' 
WHERE 
  key_id = 'c07ffdf220791e011f10e05180c40331a902c7a869dfdf0c3730d4526d2b5164' 
  AND (
    token = 'VZfyGclds4RmWYNk81jPKY2L1O+fPb+b7G8Yp+dYBWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035