UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's3Oo0zbfmv0KgEpzsyoGy417ANeaLdPlzEBLVZPHC3w=' 
WHERE 
  key_id = '3a14b1f41f52b642bd4537e8960d83115d23736f1297e65bfde4c65838b02aae' 
  AND (
    token = 's3Oo0zbfmv0KgEpzsyoGy417ANeaLdPlzEBLVZPHC3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038