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

Query time 0.00022