UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c55aFm3ZChkLSPdU5gWK+Y4KTsqCmdDIrDD2RvHzC70=' 
WHERE 
  key_id = '06414c1d0498c83a9b0c05868563a6b0f036665bf5ddec7050a390efdc286a70' 
  AND (
    token = 'c55aFm3ZChkLSPdU5gWK+Y4KTsqCmdDIrDD2RvHzC70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015