UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ol3IHV+JPdtzwmBiB1ynEhhYv2R/me1GZ1gGSBHIVo=' 
WHERE 
  key_id = '9c78016ddbfe60509bb591e373b5f56dbf036b5619b713a25029254ce767bbd8' 
  AND (
    token = '/ol3IHV+JPdtzwmBiB1ynEhhYv2R/me1GZ1gGSBHIVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037