UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E9nD7O446XhxDUF3jXyC/nd3TGV1Rs+DiKlE1ln+qIM=' 
WHERE 
  key_id = '04e82ada1505e83919dbbd298d540c52a939bc3d007c1d2c520a6e6f1696333e' 
  AND (
    token = 'E9nD7O446XhxDUF3jXyC/nd3TGV1Rs+DiKlE1ln+qIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036