UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6a1g7VpBdcTdbHcsTdleUMYKqKZcycZmaer/GfsM/nM=' 
WHERE 
  key_id = '355205df26050e265cab19b168ec15b91d36e639acc4ba355e2ab4cd0bc03cb3' 
  AND (
    token = '6a1g7VpBdcTdbHcsTdleUMYKqKZcycZmaer/GfsM/nM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027