UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+niVALpO8VbhQYJEeQY+cDUnoV/b+/y4XtdmRLb8554=' 
WHERE 
  key_id = '9657211afef61851f12fb50dbf55a25cfb4275544e79c61f2c73d00665a6c23f' 
  AND (
    token = '+niVALpO8VbhQYJEeQY+cDUnoV/b+/y4XtdmRLb8554=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047