UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vP3RV156Xf5GW/8jx4NwgCBMLWpje7+b64nIyOOMPpc=' 
WHERE 
  key_id = '69918096c3270a92e0b522f777f992582b55b370a79e85963d69289abd5da232' 
  AND (
    token = 'vP3RV156Xf5GW/8jx4NwgCBMLWpje7+b64nIyOOMPpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021