UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AZOF6sgdRI/n9TsxG3GmkaFVsaswTjRVhdK+Nwb9YSQ=' 
WHERE 
  key_id = 'df8b532b18d9ff323c314856a58995a55b3f31b6070d52b323a40ce94513de61' 
  AND (
    token = 'AZOF6sgdRI/n9TsxG3GmkaFVsaswTjRVhdK+Nwb9YSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037